---
id: 6568bfb601a54ed5b367b44f
title: Step 35
challengeType: 20
dashedName: step-35
---

# --description--

If the loop completes without finding any empty cells, the method should return `None` to indicate that the sudoku board is filled.

Return `None` outside the `for` loop block.

# --hints--

You should have `return None` outwith the `for` loop.

```js
({ test: () =>
  {
    const  empty = __helpers.python.getDef(code, "find_empty_cell");
    const {function_body} = empty;
    const indent = function_body.match(/ +/)[0];
    const re = new RegExp(`^${indent}return\\s+None`, "m");
    assert.match(function_body, re);
  }
})
```

# --seed--

## --seed-contents--

```py
class Board:
    def __init__(self, board):
        self.board = board

    def __str__(self):
        upper_lines = f'\n╔═══{"╤═══"*2}{"╦═══"}{"╤═══"*2}{"╦═══"}{"╤═══"*2}╗\n'
        middle_lines = f'╟───{"┼───"*2}{"╫───"}{"┼───"*2}{"╫───"}{"┼───"*2}╢\n'
        lower_lines = f'╚═══{"╧═══"*2}{"╩═══"}{"╧═══"*2}{"╩═══"}{"╧═══"*2}╝\n'
        board_string = upper_lines
        for index, line in enumerate(self.board):
            row_list = []
            for square_no, part in enumerate([line[:3], line[3:6], line[6:]], start=1):
                row_square = '|'.join(str(item) for item in part)
                row_list.extend(row_square)
                if square_no != 3:
                    row_list.append('║')

            row = f'║ {" ".join(row_list)} ║\n'
            row_empty = row.replace('0', ' ')
            board_string += row_empty

            if index < 8:
                if index % 3 == 2:
                    board_string += f'╠═══{"╪═══"*2}{"╬═══"}{"╪═══"*2}{"╬═══"}{"╪═══"*2}╣\n'
                else:
                    board_string += lower_lines

        return board_string


--fcc-editable-region--
    def find_empty_cell(self):
        for row, contents in enumerate(self.board):
            try:
                col = contents.index(0)                
                return row, col
            except ValueError:
                pass
        
--fcc-editable-region--
```
